<?php 
	require_once 'text03.php';
	if (empty($_POST['id'])) {
		die('id is empty');
	}
	if (empty($_POST['name'])) {
		die('name is empty');
	}
	if (empty($_POST['age'])) {
		die('age is empty');
	}
	$id=intval($_POST['id']);
	$name=$_POST['name'];
	$age=intval($_POST['age']);
	connectDB();
	mysql_query("UPDATE users SET name='$name',age=$age WHERE id=$id");//修改
	if (mysql_errno()) {
		echo mysql_errno();
	}else {
		header("location:text01.php");
	}
 ?>